﻿using AutoMapper;
using Domain.Models;

namespace ViewModel.Auth
{
    public class AccessTokenBase
    {
        public string Access_Token { get; set; }

        public string Refresh_Token { get; set; }

    }

    public class AccessToken : AccessTokenBase
    {
        public double Expired { get; set; }

        public string UserName { get; set; }

    }

    public class AccessTokenProfile : Profile
    {
        public AccessTokenProfile()
        {
            CreateMap<AccessToken, AuthToken>()
                .ForMember(des => des.AccessToken, source => source.MapFrom(x => x.Access_Token))
                .ForMember(des => des.RefreshToken, source => source.MapFrom(x => x.Refresh_Token))
                .ReverseMap();
        }
    }
}
